:root {
  --bg: #0b0f17;
  --bg-accent: #0e1320;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.95);
  --text-muted: rgba(255, 255, 255, 0.70);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
  --radius-lg: 14px;
  --radius-sm: 10px;
  --accent: #6ea8fe;
  --accent-2: #9b7bff;
  --success: #3dd6d0;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f8fc;
    --bg-accent: #ffffff;
    --surface: rgba(12, 18, 28, 0.06);
    --surface-strong: rgba(12, 18, 28, 0.1);
    --text: rgba(20, 24, 32, 0.95);
    --text-muted: rgba(20, 24, 32, 0.70);
    --border: rgba(12, 18, 28, 0.12);
    --shadow: 0 10px 32px rgba(12, 18, 28, 0.10);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 10% 10%, rgba(110, 168, 254, 0.10), transparent 40%),
    radial-gradient(1200px 800px at 90% 20%, rgba(155, 123, 255, 0.10), transparent 42%),
    radial-gradient(1200px 800px at 50% 100%, rgba(61, 214, 208, 0.10), transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-accent) 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(1200px 800px at 10% 10%, rgba(110, 168, 254, 0.10), transparent 40%),
    radial-gradient(1200px 800px at 90% 20%, rgba(155, 123, 255, 0.10), transparent 42%),
    radial-gradient(1200px 800px at 50% 100%, rgba(61, 214, 208, 0.10), transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-accent) 100%),
    url("bg.png");
  background-size: auto, auto, auto, auto, cover;
  background-position: center center;
  background-attachment: fixed;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 22px 24px;
}

.title {
  margin: 0 0 14px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.3px;
  background: linear-gradient(90deg, var(--text) 0%, rgba(255, 255, 255, 0.75) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 18px rgba(110, 168, 254, 0.16);
}

.code-content {
  position: relative;
  margin-top: 10px;
  padding: 18px 18px 20px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", "Fira Code",
    "JetBrains Mono", Consolas, "Liberation Mono", Courier, monospace;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  /* 保留换行 */
  word-break: break-word;
  /* 长行断词 */
  overflow: auto;
}

/* 顶部终端条装饰 */
.code-content::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 34px;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03));
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

/* 三色窗口按钮 */
.code-content::after {
  content: "";
  position: absolute;
  top: 11px;
  left: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f56;
  /* red */
  box-shadow:
    16px 0 0 #ffbd2e,
    /* yellow */
    32px 0 0 #27c93f;
  /* green */
  opacity: 0.9;
}

/* 让正文不被顶部条覆盖 */
.code-content {
  padding-top: 48px;
}

/* 高亮库（若输出包含 <code>/<pre>）的优化 */
pre,
code {
  font-family: inherit;
  font-size: inherit;
}

.code-content pre {
  margin: 0;
  background: transparent !important;
}

/* 自定义滚动条（可选，兼容现代浏览器） */
.code-content::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.code-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  border: 1px solid var(--border);
  border-radius: 999px;
}

.code-content::-webkit-scrollbar-track {
  background: transparent;
}

/* 选中文本颜色 */
::selection {
  background: rgba(110, 168, 254, 0.35);
  color: #fff;
}

.copyright {
  margin-top: 16px;
  padding-top: 4px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
}

/* 小屏优化 */
@media (max-width: 640px) {
  .container {
    padding: 22px 14px 18px;
  }

  .title {
    font-size: 24px;
  }

  .code-content {
    font-size: 13px;
    padding: 44px 12px 14px 12px;
  }
}